package cc.taofoo.CCSP.ztrace;

public class Th {
    public static String thousandSeparator(int n) {
        StringBuffer sb = new StringBuffer(String.valueOf(n));

        for (int i = sb.length() - 3; i > 0; i -= 3)
            sb.insert(i, '.');
        return sb.toString();
    }


    public static void main(String[] args) {
        System.out.println(thousandSeparator(123456));
        System.out.println(thousandSeparator(1234567));
        System.out.println(thousandSeparator(0));
    }

}
